#!/bin/sh

if [ `uname -m` = armv5b ]; then
  cat >> %OPTWARE_TARGET_PREFIX%/etc/ipkg/arch.conf << EOF
arch all 1
arch any 6
arch noarch 11
arch armeb 16
arch ixp4xxbe 21
arch fsg3be 26
EOF
fi

touch /etc/profile
if ! grep '^PATH=.*%OPTWARE_TARGET_PREFIX%/bin' /etc/profile >/dev/null 2>&1 ; then
  echo "PATH=\$PATH:%OPTWARE_TARGET_PREFIX%/bin:%OPTWARE_TARGET_PREFIX%/sbin" >> /etc/profile
fi

rm -f /etc/rc/S98optware
ln -s /etc/init.d/optware /etc/rc/S98optware
